<?php
echo $this->Html->script(array(
	'colorpicker'), array('inline' => false));
echo $this->Html->css(array(
	'colorpicker'), null, array('inline' => false));
?>
<?php
echo $this->Form->create('Reward', array(
	'class' => 'validate',
	'action' => 'edit',
	'url' => $this->request->here(false),
	'type' => 'post',
	'inputDefaults' => array('label' => false, 'div' => false)));
echo $this->Form->input('Paginate.task', array('style' => 'display:none;', 'value' => '', 'id' => 'task'));
?>
<div class="page-header">
	<div class="icon">
		<span class="ico-pen-2"></span>
	</div>
	<h1>
		<?php echo __('Add new rewards'); ?> 
	</h1>
	<div class="page-toolbar pull-right">
		<div class="btn-group ctr-container">
			<a class="btn btn-primary ctr-add" href="<?php echo Router::url(array('controller' => 'users','action' => 'index')) ?>">
				<span class="ico-add"></span>
				<?php echo __('Users management'); ?>
			</a>
			<!--
			<a class="btn btn-primary ctr-add" href="<?php echo Router::url(array('controller' => 'rewards' ,'action' => 'index')) ?>">
				<span class="ico-add"></span>
				<?php echo __('Rewards management'); ?>
			</a>
			-->
		</div>
	</div>
</div>
<div class="row-fluid">
	<?php echo $this->Session->flash(); ?>
</div>
<div class="row-fluid">

	<div class="span6">                

		<div class="block">
			<div class="head">                                
				<h2><?php echo __('Basic info'); ?></h2>                     
			</div>                                        
			<div class="data-fluid">

				<div class="row-form">
					<div class="span3"><?php echo __('Name'); ?>:</div>
					<div class="span9">
						<?php
						echo $this->Form->input('name', array('type' => 'text'));
						?> 
					</div>
				</div>
				<div class="row-form">
					<div class="span3"><?php echo __('Percentage'); ?>:</div>
					<div class="span9">
						<?php
						echo $this->Form->input('percentage', array('type' => 'text'));
						?>  
					</div>
				</div>
			</div>
		</div>

	</div>

	<div class="span6">                

		<div class="block">
			<div class="head">                                
				<h2><?php echo __('Other info'); ?></h2>                                                            
			</div>                                    
			<div class="data-fluid">

				<div class="row-form">
					<div class="span3"><?php echo __('Color'); ?>:</div>
					<div class="span9">
						<?php
						echo $this->Form->input('color', array('type' => 'text'));
						?>                         
					</div>
				</div>

				<div class="row-form">
					<div class="span3"><?php echo __('Weight'); ?>:</div>
					<div class="span9">
						<?php
						echo $this->Form->input('weight', array('type' => 'text'));
						?>                         
					</div>
				</div>

			</div>                
		</div>
	</div>     

	<div class="span11">
		<div class="span6">
			<div class="span3">&nbsp;</div>
			<div class="span9">
				<div class="btn-group ctr-container">
					<button class="btn btn-large btn-info" type="reset"><?php echo __('Reset'); ?></button>
					<button class="btn btn-large btn ctr-save" type="submit"><?php echo __('Submit'); ?></button>
				</div>
			</div>
		</div>
	</div>
</div>
<?php echo $this->Form->end(); ?>
<script type="text/javascript">
		(function() {
			$('#RewardColor').ColorPicker({
				onChange: function(hsb, hex, rgb) {
					$('#RewardColor').val(hex);
				},
				onBeforeShow: function() {
					$(this).ColorPickerSetColor(this.value);
				}
			});
		})(jQuery);
</script>